//
//  PhotoModel.m
//  TestDemo
//
//  Created by apple on 16/5/2.
//  Copyright © 2016年 apple. All rights reserved.
//

#import "PhotoModel.h"

@implementation PhotoModel

-(instancetype)initWithDic:(NSDictionary *)dic{
    if (self = [super init]) {
        self.fileId = [dic[@"FILE_ID"]stringValue];
        self.itemId = dic[@"ITEM_ID"];
        self.imageName = dic[@"FILE_NAME"];
        NSString *serverIp = [[NSUserDefaults standardUserDefaults]objectForKey:@"ip"];
        self.url = [NSString stringWithFormat:@"http://%@/INFO_DMS_WEB/download?APP_ID=AttachmentPhoto&FILE_ID=%@&FILE_OWNER=%@",serverIp,self.fileId,dic[@"ENTITY_CODE"]];
    }
    return self;
}

+(instancetype)photoModelWithDic:(NSDictionary *)dic{
    return [[self alloc]initWithDic:dic];
}

@end
